/**
 * @file       lcd_application_main.h
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Feb 3, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef LCD_APPLICATION_MAIN_H_
#define LCD_APPLICATION_MAIN_H_
#include "LCDApp.h"

namespace NS_LCD_AFW
{

#define LCD_APPLICATION_MAIN(APP_CLASS_NAME)                                                   \
	static APP_CLASS_NAME g_Application;                                                       \
	int main(int argc,char *argv[])                                                            \
	{                                                                                          \
		int iRet = ERR_SUCCESS;                                                                \
		CLCDApp *pApp = &g_Application;                                                        \
		if (ERR_SUCCESS != (iRet = pApp->initApp(argc,argv)))                                  \
		{                                                                                      \
			return iRet ;                                                                      \
		}                                                                                      \
		if (ERR_SUCCESS != (iRet = pApp->initInstance()))                                      \
		{                                                                                      \
			return iRet;                                                                       \
		}                                                                                      \
		return pApp->run();                                                                    \
	}

}

#endif /* LCD_APPLICATION_MAIN_H_ */
